#pragma once

#include "TcpServer.h"
#include "TcpClient.h"
#include "UDPSocket.h"
#include "UDPGroup.h"
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QListWidget>
#include <QtWidgets/QListWidgetItem>
#include <QtWidgets/QStackedWidget>
#include <QtWidgets/QComboBox>

class Widget :
    public QWidget
{
public:
    Widget(QWidget* parent = nullptr);

private:
    QPushButton* btn_creat = nullptr, * btn_delete = nullptr;
    QListWidget* listWidget = nullptr;
    QGridLayout* mainLayout = nullptr,
        * left_layout = nullptr,
        * right_layout = nullptr,
        * top_layout = nullptr;
    QGroupBox* leftBox = nullptr, * topBox = nullptr;

    QStackedWidget* w = nullptr;
    QLineEdit* ldt_ip,*ldt_port;
    QComboBox* comboBox;
    QMap<QListWidgetItem*, QWidget*> item_list;

    bool ip_true = true;

    void On_Creat();
    void On_Delete();
    void OnEditIpFinshed();
    virtual void closeEvent(QCloseEvent* event);

    

};

